//Sort type Enumeration for visualization purposes
//This is the value member of the Sort type select element (Dropdown list)
var sortTypeEnum = {
         ResourceType:"resource_type",
		 DisplayTitle:"display_title",
		 MediaType:"media_type",
		 Language:"language"
	}

//Filtering object
function ViewSearchCriteria() {
	ViewSearchCriteria.prototype.key = ko.observable("");
	
	ViewSearchCriteria.prototype.sortOrders = [
		{description: 'ASC', value : true},
		{description: 'DESC', value : false}
	];
	ViewSearchCriteria.prototype.chosenSortOrder = ko.observable(this.sortOrders[0]);
	ViewSearchCriteria.prototype.sortTypes = [
		{ description:'Resource Type', value:sortTypeEnum.ResourceType},
		{ description:'Display Title',value:sortTypeEnum.DisplayTitle},
		{ description:'Media Type',value:sortTypeEnum.MediaType},
		{ description:'Language', value:sortTypeEnum.Language}
	];
	ViewSearchCriteria.prototype.chosenSortType = ko.observable(this.sortTypes[0]);
	
	ViewSearchCriteria.prototype.getSearchCriteria = function(){
		var filter = new SearchCriteria();
		filter.searchText = this.key();
		filter.sortASC = this.chosenSortOrder().value;
		filter.sortType = this.chosenSortType().value;
		return filter;
	}
}




	
	
	
	
	